#include "thread/sync.h"
#include "interrupt/interrupt.h"
/*
* Function: sema_init
* parameters: 
*			psema: the semaphore to be initialized
*			value: the initial value of the semaphore
* Return: 
*           void ----------------------------------------------------
* 初始化信号量
*/
void sema_init(struct semaphore* psema, uint8_t value) {
    psema->value = value;
    list_init(&psema->wait_list);
}

/*
* Function: lock_init
* parameters: 
*			plock: the lock to be initialized
* Return: 
*           void ----------------------------------------------------
* 初始化锁
*/
void lock_init(struct lock* plock) {
    plock->holder = NULL;
    plock->holder_repeat_count = 0;
    sema_init(&plock->semaphore, 1);
    
}

void sema_down(struct semaphore* psema) {

}